#ifndef __WORLD_H__
#define __WORLD_H__

#pragma once
#include "GuiController.h"
#include "PlayerController.h"
//@author dylan
class GuiController;
class PlayerController;

class World
{
	public:
		World(WindowFramework *w,GuiController *g,PlayerController *p);
		WindowFramework *window;
		GuiController *gui;
		PlayerController *player;
		//shaders
		void CreateWater(NodePath n);
		void CreateSkyBox();
		NodePath sky_box;
		NodePath water_camera;
		NodePath water;
		Texture *w_texture;
		NodePath w_plane_node;
		LPlanef w_plane;
		//physics
		BulletWorld *p_world;
		BulletDebugNode *p_debug;
		NodePath p_debug_n;
		//input
		double mx;
		double my;
		void InitInput();
		void Process(const Event * theEvent);
		bool Remove(std::string Event,std::set<std::string>* n);
		std::set<std::string> down_keys;
		std::set<std::string> once_down_keys;
		MouseWatcher *mouseWatcher;
		bool check_input();
		//state
		std::string state;
		void LoadMap(std::string name);
		void CreateLights();
		void LoadPhysics();
		void DrawDebug(bool state);
		BulletRigidBodyNode *PhysicsCube(float x,float y,float z,float weight);
		BulletRigidBodyNode *PhysicsSphere(float r,float weight);
		BulletRigidBodyNode *PhysicsTriangleMesh(GeomNode *n);
		bool Update();
		~World();
	private://map nodes keep as many hidden so i cant fuck with them.
		NodePath m_mesh;
		vector<NodePath> m_lights;
		vector<NodePath> m_objects;
};
#endif 